home *** CD-ROM | disk | FTP | other *** search
/ Knitting Made Easy / Knitting.iso / App / Patterns.dxr / behaviors_34_Click Behavior(noSound).ls < prev    next >
Encoding:
Text File  |  2002-04-18  |  2.5 KB  |  73 lines

  1. property Action, WhichLabel, standardImage, alternateImage
  2.  
  3. on mouseDown
  4.   if sprite(20).mediaBusy then
  5.     videopause(sprite(20))
  6.   end if
  7.   emem = the memberNum of sprite clickOn()
  8.   set the memberNum of sprite clickOn() to emem + 1
  9.   updateStage()
  10.   repeat while the stillDown
  11.     if rollover(clickOn()) then
  12.       set the memberNum of sprite clickOn() to emem + 1
  13.     else
  14.       set the memberNum of sprite clickOn() to emem - 1
  15.     end if
  16.     updateStage()
  17.   end repeat
  18.   updateStage()
  19.   set the memberNum of sprite clickOn() to emem
  20.   updateStage()
  21.   if Action = "Go to marker" then
  22.     go(WhichLabel)
  23.   else
  24.     if Action = "Play marker" then
  25.       play frame WhichLabel
  26.     end if
  27.   end if
  28. end
  29.  
  30. on beginSprite me
  31.   me.standardImage = the member of sprite me.spriteNum
  32.   memref = the member of sprite the currentSpriteNum
  33.   castLibNum = memref.castLibNum
  34.   alternateImage = member(memref.memberNum + 1, castLibNum)
  35. end
  36.  
  37. on mouseWithin me
  38.   set the member of sprite the spriteNum of me to me.alternateImage
  39. end
  40.  
  41. on mouseEnter me
  42.   set the member of sprite the spriteNum of me to me.alternateImage
  43. end
  44.  
  45. on mouseLeave me
  46.   if the mouseUp then
  47.     set the member of sprite the spriteNum of me to me.standardImage
  48.   end if
  49. end
  50.  
  51. on getPropertyDescriptionList
  52.   global ibcDefaultParams
  53.   if the currentSpriteNum = 0 then
  54.     memdefault = 0
  55.   else
  56.     memref = the member of sprite the currentSpriteNum
  57.     castLibNum = memref.castLibNum
  58.     memdefault = member(memref.memberNum + 1, castLibNum)
  59.   end if
  60.   if listp(ibcDefaultParams) then
  61.     return ibcDefaultParams
  62.   else
  63.     description = [:]
  64.     addProp(description, #Action, [#default: "None", #range: ["None", "Go to marker", "Play marker"], #format: #symbol, #comment: "MouseUp Action:"])
  65.     addProp(description, #WhichLabel, [#comment: "Destination Marker:", #format: #marker, #default: "next"])
  66.     return description
  67.   end if
  68. end
  69.  
  70. on getBehaviorDescription
  71.   return "- Click Behavior -" & RETURN & "Defined: controls a dual-image button." & RETURN & "Intended Use: to give user a simple audio + visual feedback that they've engaged a control. Rolling off button during mouseDown will disengage." & RETURN & RETURN & "- Properties -" & RETURN & "MouseUp Action: assigns a button course of action." & RETURN & "  (Note: Select 'None' if you plan to add a seperate mouseUp behavior to this button)" & RETURN & "Destination Marker: assigns a destination to the course of action." & RETURN & RETURN & "(Explore the 'LookHere' folder on the CD-Rom for examples of each behavior)"
  72. end
  73.